当前位置:flash课件吧→教育→教育教学栏目

www.luotao2008.cn视频网校,仅需要一个耳机+QQ远程即可完成所有教学任务。

题 目:如何在.swf课件中实现画线画图和清除功能

我在一个破解得的课件中发现有你说的功能,但不很全。
画线的代码为:onClipEvent (load) {
this.createTextField("tip", 0, 0, -10, 0, 0);
with (tip) {
autoSize = "center";
type = "dynamic";
textColor = 16711680;
}
path = _parent._parent.paper;
this.onRelease = function() {
var Register_1_ = _parent;
Register_1_.handler4();
if (_currentframe == 1) {
Register_1_.handler();
gotoAndStop(2);
Register_1_._parent.mask._visible = true;
tip.text = "èú";
} else {
gotoAndStop(1);
tip.text = "ú";
}
tabEnabled = false;
};
this.onRollOver = function() {
if (_currentframe == 1) {
tip.text = "ú";
} else {
tip.text = "èú";
}
};
this.onRollOut = function() {
tip.text = "";
};
this.onMouseDown = function() {
if (_currentframe == 2 && path.write) {
down = true;
n = path.n;
path.createEmptyMovieClip(("instance" + n), n);
with (path[("instance" + n)]) {
lineStyle(3, path.RGB, 100);
moveTo(path._xmouse, path._ymouse);
lineTo((path._xmouse + 0.201), (path._ymouse + 0.201));
}
}
};
this.onMouseMove = function() {
if (down && path.write) {
with (path[("instance" + n)]) {
lineTo(path._xmouse, path._ymouse);
}
}
};
this.onMouseUp = function() {
if (down) {
down = false;
n++;
path.n = path.m = n;
}
};
}

清除的代码为:
on (release) {
n = 0;
while (n < path.n) {
path[("instance" + n)].removeMovieClip();
path[("instance" + n)].removeTextField();
n++;
}
path.n = path.m = 0;
handler1();
}

我不知道得很详细,但能实现你说的功能,不知你是否满意??

 

 

 

FLASH课件制作培训班开班了!火热报名中!加我站管理QQ444860709解决任何疑问! 培训QQ专业群67042004。